#include "tstate.h"

TState::TState(int State, QObject *parent) :
    QObject(parent),
    state(State),
    stateColor(new QColor())
{
}


QString TState::getState(void){
    QString reply;
    switch (state){
        case 0:
        reply = QString("Pending");
        break;
        case 1:
        reply = QString("Stop");
        break;
        case 2:
        reply = QString("Watching");
        break;
        case 3:
        reply = QString("On Demand");
        break;
    case 4:
        reply = QString("Waiting");
        break;
    }
    return reply;
}

QColor TState::getColor(void){
    QColor reply;
    switch (state){
        case 0:
        reply = QColor(Qt::gray);
        break;
        case 1:
        reply = QColor(Qt::red);
        break;
        case 2:
        reply = QColor(Qt::green);
        break;
        case 3:
        reply = QColor(Qt::green);
        break;
        case 4:
        reply = QColor(Qt::yellow);

    }
    return reply;
}

int TState::getStateInt(void){
    return state;
}

void TState::setStateInt(int State){
    state = State;
    emit isChanged();
}
